package com.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.demo.entity.OrderEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface OrderMapper extends BaseMapper<OrderEntity> {

    @Insert("insert into tb_order(member_id,order_num,order_amount,goods_Id,order_time) values " +
            "(#{memberId}, #{orderNum}, #{orderAmount}, #{goodsId},#{orderTime})")
    @Options(useGeneratedKeys = true, keyProperty = "orderId")
    int saveOrder(OrderEntity order);

}